/*
 *	Copyright © 2013 Changsha Shishuo Network Technology Co., Ltd. All rights reserved.
 *	长沙市师说网络科技有限公司 版权所有
 *	http://www.shishuo.com
 */

package com.hlingsoft.cms.dao;

import com.hlingsoft.cms.entity.AppUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;



@Repository
public interface AppUserDao {



	/**
	 * 添加商品
	 * 
	 * @return Integer
	 */
	public long addAppUser(AppUser appUser);


	/**
	 * 通过手机查找用户
	 * @param phone
	 * @return
	 */
	public AppUser getUserByPhone(@Param("phone") String phone);


	/**
	 * 更新用户
	 * @param appUser
	 * @return
	 */
	public int updateUser(AppUser appUser);

	/**
	 * 通过wechtId查询用户
	 * @param weChatId
	 * @return
	 */
	public AppUser getUserByWeChatId(@Param("weChatId") String weChatId);


	/**
	 *  获取所有有效用户
	 * @return
	 */
	public List<AppUser> getUserList();

	/**
	 * 获取所有用户
	 * @return
	 */
	public List<AppUser> getAllUserList(@Param("offset") int offset,@Param("rows")int rows);


	/**
	 * 获取用户数量
	 * @return
	 */
	public int getUserListCount();

	/**
	 * 获取所有用户数量
	 * @return
	 */
	public int getAllUserListCount();

	/**
	 * 禁用账户
	 * @param id
	 * @return
	 */
	public int deleteUserById(@Param("id") long id);

	/**
	 * 启用账户
	 * @param id
	 * @return
	 */
	public int getOnUserById(@Param("id") long id);

	/**
	 * 根据id查找
	 * @param appUserId
	 * @return
	 */
	public AppUser getUserById(@Param("appUserId") long appUserId);



	public List<AppUser> getDaRen(@Param("offset") int offset,@Param("rows")int rows);


    public List<AppUser> getUserByName(@Param("name")String name);


}
